@RestResource(urlMapping='/stu/*')
global without sharing class MyRestAPIDemo {

    @HttpGet  // 请求地址就是/student/test1
    global static String test1() {
        System.debug('reqest rest api');
        RestContext.response.statusCode = 200;
        return 'https://www.baidu.com/img/PCtm_d9c8750bed0b3c7d089fa7d55720d6cf.png';
    }


    @HttpPost
    global static String test2() {
        String reqData = RestContext.request.requestBody.toString();
        Student__c stu = (Student__c)JSON.deserialize(reqData, Student__c.class);
        return stu == null ? '' : stu.Remark__c;
    }
}